package com.eastmoney.emis.edda.infrastructure.util;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.infrastructure.util
 * @author: 汪程程
 * @date: 2023/2/23 1:18 PM
 * @version: 1.0
 */
public class CutoffTimeUtils {

    public static boolean isEddiPauseTime() {
        LocalDate date = LocalDate.now();
        LocalDateTime beginThreshold = LocalDateTime.of(date, LocalTime.of(20, 59));
        LocalDateTime endThreshold = LocalDateTime.of(date, LocalTime.of(21, 1));
        LocalDateTime now = LocalDateTime.now();
        return now.isAfter(beginThreshold) && now.isBefore(endThreshold);
    }



    public static boolean isCutoffTime() {
        LocalDateTime cutoffTime = LocalDateTime.of(LocalDate.now(), LocalTime.of(21, 0));
        LocalDateTime now = LocalDateTime.now();
        return now.isEqual(cutoffTime) || now.isAfter(cutoffTime);


    }
}
